﻿#region Disclaimer/Info

/////////////////////////////////////////////////////////////////////////////////////////////////
//
//   File:		ResourcesController.cs
//   Website:		http://dexterblogengine.com/
//   Authors:		http://dexterblogengine.com/About.ashx
//   Rev:		1
//   Created:		19/01/2011
//   Last edit:		19/01/2011
//   License:		GNU Library General Public License (LGPL)
// 
//   For updated news and information please visit http://dexterblogengine.com/
//   Dexter is hosted to Codeplex at http://dexterblogengine.codeplex.com
//   For any question contact info@dexterblogengine.com
//
///////////////////////////////////////////////////////////////////////////////////////////////////

#endregion

using System.Web.Mvc;
using Dexter.Caching;
using Dexter.Logger.Contracts;
using Dexter.Search;
using Dexter.Services;
using Dexter.Web.Core;
using Dexter.Web.Mvc.Configuration;
using Dexter.Web.Mvc.Results;
using Dexter.Web.Utils;

namespace Dexter.Web.Mvc.Controllers {
	public class ResourcesController : PublicControllerBase {
		readonly ICacheProvider cacheService;
		readonly IResourceConfiguration resouConfiguration;


		public ResourcesController ( ISearchService searchService, ICommentService commentService, IReferrerService referrerService, IConfigurationService configurationService, IWebUtils webUtils, ILogger logger, IUrlBuilder urlBuilder, IBlogRollService blogRollService, ICategoryService categoryService, IPostService postService, IThemeManager themeManager, ITagService tagService, IPageService pageService, ICacheProvider cacheService, IHostEnvironment hostEnvironment , IResourceConfiguration resouConfiguration )
			: base ( searchService, commentService, referrerService, configurationService, webUtils, logger, urlBuilder, blogRollService, categoryService, postService, themeManager, tagService, pageService ) {
			this.cacheService = cacheService;
			this.resouConfiguration = resouConfiguration;
		}

		[AcceptVerbs ( HttpVerbs.Get )]
		public ActionResult Css ( string id ) {
			return new StylesheetCombinedResult ( id, resouConfiguration, cacheService );
		}

		[AcceptVerbs ( HttpVerbs.Get )]
		public ActionResult Js ( string id ) {
			return new JavascriptCombinedResult ( id, resouConfiguration, cacheService );
		}
	}
}